<?php
// Copyright (C) 2011 Cassian LUP <cassi.lup@gmail.com>
//
 // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//SANITIZE ALL ESCAPES
$sanitize_all_escapes = true;

//STOP FAKE REGISTER GLOBALS
$fake_register_globals = false;

//continue session
if (!isset($_REQUEST['medico']))
    session_start();
//
//landing page definition -- where to go if something goes wrong
$landingpage = "index.php?site=" . $_SESSION['site_id'];
//
// kick out if patient not authenticated
if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite'])) {
    $pid = $_SESSION['pid'];
} else {
    session_destroy();
    header('Location: ' . $landingpage . '&w');
    exit;
}
//

$ignoreAuth = true;
include_once('../interface/globals.php');

$sql = "SELECT * FROM lists WHERE pid = ? AND type = 'medication' ORDER BY begdate";

$res = sqlStatement($sql, array($pid));

require_once("$srcdir/options.inc.php");
require_once("../interface/globals.php");
require_once("$srcdir/patient.inc");
require_once("$srcdir/acl.inc");
require_once("$srcdir/classes/Address.class.php");
require_once("$srcdir/classes/InsuranceCompany.class.php");
require_once("$srcdir/classes/Document.class.php");
require_once("$srcdir/options.inc.php");
require_once("../interface/patient_file/history/history.inc.php");
require_once("$srcdir/formatting.inc.php");
require_once("$srcdir/edi.inc");
include_once("$srcdir/lists.inc");
require_once("$srcdir/sql.inc");
?>

<!-- Start Recordatorios Clinicos y Medicamentos -->

<div style="width: 100%;">
    <div style="margin-right: 5px;" class="medicamentos1">
        <div style="background-color: rgb(94, 186, 182); border-radius: 5px 5px 5px 5px; padding: 8px; font-size: 14px; color: rgb(255, 255, 255);">
            <span>Medicamentos</span>
        </div>
        <div style="padding: 10px;">
<?php if (sqlNumRows($res) > 0) { ?>
                <div class="notab" id="medicationlist_ps_expand"></div>
    <?php
} else {
    echo "<tr><td>No se han ingresado medicamentos.</td></tr>";
}
?>
        </div>

    </div>
    <div class="medicamentos2">
        <div style="background-color: rgb(94, 186, 182); border-radius: 5px 5px 5px 5px; padding: 8px; font-size: 14px; color: rgb(255, 255, 255);">
            <span>Signos Vitales</span>
        </div>
        <div id="signos" style="padding: 10px;"></div>
    </div>
</div>
<!-- End Recordatorios Clinicos y Medicamentos -->

